package ControlLayer;
import ModelLayer.DiscountType;
import DBLayer.DBDiscountType;
import java.util.ArrayList;

public class CtrDiscountType {
    // <editor-fold defaultstate="collapsed" desc="Attributes & Constructors">
    private static CtrDiscountType instance = null;
    DBDiscountType dbDiscountType = new DBDiscountType();

    public CtrDiscountType() {
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Methods">
    public static CtrDiscountType getInstance() {
        if (instance == null) {
            instance = new CtrDiscountType();
        }
        return instance;
    }

    public ArrayList<DiscountType> getDiscountTypeList() {
        return dbDiscountType.getDiscountTypeList();
    }

    public DiscountType getDiscountTypeByID(int id) {
        return dbDiscountType.getDiscountTypeByID(id);
    }

    public int addDiscountType(DiscountType discountType) {
        return dbDiscountType.addDiscountType(discountType);
    }

    public int updateDiscountType(DiscountType discountType, int id) {
        return dbDiscountType.updateDiscountType(discountType, id);
    }

    public void deleteDiscountType(int id) {
        dbDiscountType.deleteDiscountType(id);
    }
    // </editor-fold>
}
